{include file="public/nheader"}
<div class="layui-fluid layui-bg-white">
    <form action="{:url()}" class="layui-form layui-form-fixed">
        <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>名称
            </label>
            <div class="layui-input-block">
                <input type="text" name="name" required="" lay-verify="required" autocomplete="off" class="layui-input"
                    value="{$row.name|default=''}" placeholder="请填写名称">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                密码(填写表示修改)
            </label>
            <div class="layui-input-block">
                <input type="password" name="password" autocomplete="off" class="layui-input" value="" placeholder="密码">
            </div>
        </div>
        <!-- <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>是否团队长
            </label>
            <div class="layui-input-block">
                <input type="radio" name="istdz" value="1" title="否" {if empty($row['istdz']) ||
                    $row['istdz']==1}checked{/if}>
                <input type="radio" name="istdz" value="2" title="是" {if !empty($row['istdz']) &&
                    $row['istdz']==2}checked{/if}>
            </div>
            <div class="layui-input-block" style="color: red;">团队长设置前接的订单不会会产生收益,取消前接的订单依然会计算收益</div>
        </div> -->
        <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>状态
            </label>
            <div class="layui-input-block">
                <input type="radio" name="status" value="1" title="在线" {if empty($row['status']) ||
                    $row['status']==1}checked{/if}>
                <input type="radio" name="status" value="2" title="忙碌" {if empty($row['status']) ||
                    $row['status']==2}checked{/if}>
                <input type="radio" name="status" value="3" title="下线" {if empty($row['status']) ||
                    $row['status']==3}checked{/if}>

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>身份证号
            </label>
            <div class="layui-input-block">
                <input type="text" name="cards" required="" lay-verify="required" autocomplete="off" class="layui-input"
                    value="{$row.cards|default=''}" placeholder="身份证号">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>手机号
            </label>
            <div class="layui-input-block">
                <input type="number" name="mobile" required="" lay-verify="required" autocomplete="off"
                    class="layui-input" value="{$row.mobile|default=''}" placeholder="手机号">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                服务工号:
            </label>
            <div class="layui-input-block">
                <input type="text" name="bh" autocomplete="off" class="layui-input" value="{$row.bh|default=''}"
                    placeholder="填写服务工号">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                身份证正面
            </label>
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="test1">上传图片</button>
                <div class="layui-upload-list">
                    <input type="hidden" value="{$row.positive|default=''}" name="positive" id="covers">
                    <img class="layui-upload-img" id="demo1" src="{$row.positive|default=''}"
                        style="width: 200px;height: auto;">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                身份证反面
            </label>
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="test1">上传图片</button>
                <div class="layui-upload-list">
                    <input type="hidden" value="{$row.negative|default=''}" name="negative" id="covers2">
                    <img class="layui-upload-img" id="demo2" src="{$row.negative|default=''}"
                        style="width: 200px;height: auto;">
                </div>
            </div>
        </div>
        <div class="layui-footer layui-form-item layui-center ">
            <input type="hidden" value="{$row['id']|default='0'}" name="id" />
            <button class="layui-btn" lay-filter="submitIframe" type="button" lay-submit>提交</button>
            <button class="layui-btn layui-btn-primary" type="button" sa-event="closeDialog">取消</button>
        </div>
    </form>
</div>
{include file="public/nfooter"}
<script>
    layui.use(['form', 'layer', 'upload'], function () {
        $ = layui.jquery;
        var form = layui.form
            , upload = layui.upload
            , element = layui.element
            , layer = layui.layer;
        //图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            , url: '/base/upload_img'
            , accept: 'images'
            , before: function (obj) {
                layer.load(); //上传loading
            }, done: function (res) {
                //如果上传失败
                if (res.code == 1) {
                    layer.closeAll('loading'); //关闭loading
                    return layer.msg('图片上传失败，请重试');
                }
                if (res.code == 200) {
                    //上传成功
                    $('#demo1').attr('src', res.url); //图片链接（base64）
                    $('#covers').val(res.url);
                    layer.closeAll('loading'); //关闭loading
                    return layer.msg('图片上传成功');
                }
            }
            , error: function () {
                layer.closeAll('loading'); //关闭loading
                return layer.msg(res.msg);
            }
        });
        //图片上传
        var uploadInst = upload.render({
            elem: '#test2'
            , url: '/base/upload_img'
            , accept: 'images'
            , before: function (obj) {
                layer.load(); //上传loading
            }, done: function (res) {
                //如果上传失败
                if (res.code == 1) {
                    layer.closeAll('loading'); //关闭loading
                    return layer.msg('图片上传失败，请重试');
                }
                if (res.code == 200) {
                    //上传成功
                    $('#demo2').attr('src', res.url); //图片链接（base64）
                    $('#covers2').val(res.url);
                    layer.closeAll('loading'); //关闭loading
                    return layer.msg('图片上传成功');
                }
            }
            , error: function () {
                layer.closeAll('loading'); //关闭loading
                return layer.msg(res.msg);
            }
        });
    });
</script>